<?php
/**
 * Created by PhpStorm.
 * User: ycbwl
 * Date: 2018/10/23
 * Time: 12:09 AM
 */
namespace  app\api\model;

class User extends Base {

    protected $table = 'user';

    public function address(){
        return $this->hasOne('Address','user_id','id');
    }

    public static function getByOpenID($openid){
        $user = self::where("openid",$openid)->find();
        return $user;
    }

}